<?php
namespace ListMenu\Controller;

use Zend\Mvc\Controller\AbstractActionController;

class HeadController extends AbstractActionController
{
	
	public function headsAction($title=null){
		$renderer = $this->getServiceLocator()->get('Zend\View\Renderer\PhpRenderer');
		$getjquest  = $this->getEvent()->getRouteMatch()->getParams();
		$resource = $getjquest['controller'] . '-' . $getjquest['action'];
		
		switch ($resource) {
			case 'ListMenu\Controller\Index-index':
				$renderer->headTitle('Danh sách Menu');
				$renderer->headLink()->appendStylesheet('/public/template/backend/css/backend.css');
				$renderer->headScript()->appendFile('/public/template/backend/js/backend.js');
				break;
			case 'ListMenu\Controller\Index-add':
				$renderer->headTitle('Thêm loại menu');
				$renderer->headLink()->appendStylesheet('/public/template/backend/css/backend.css');
				$renderer->headScript()->appendFile('/public/template/backend/js/backend.js');
				break;
			case 'ListMenu\Controller\Index-edit':
				$renderer->headTitle($title);
				$renderer->headLink()->appendStylesheet('/public/template/backend/css/backend.css');
				$renderer->headScript()->appendFile('/public/template/backend/js/backend.js');
				break;
			default:
				return ;
				break;
		}
	}
}